home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / fviewsrc.zip / UNZIP.H < prev   
C/C++ Source or Header  |  1993-01-04  |  2KB  |  78 lines

  1. #define STRSIZ          256
  2. #define INBUF_SIZE      8192
  3. #define OUTBUF_SIZE     32768
  4. #define DLE             144
  5. #define MAX_BITS        13
  6. #define INIT_BITS       9
  7. #define HSIZE           8192
  8. #define FIRST           257
  9. #define CLEAR           256
  10.  
  11.  
  12. extern FILE *Log_fp;
  13.  
  14. byte         *inbuf;
  15. byte         *inptr;
  16.  
  17. long        packed;        /* File's compressed size */
  18. long        unpacked;        /* File's unpacked size */
  19. int         method;        /* Packing method */
  20.  
  21. int         incnt;        /* Number of bytes in input buffer */
  22. unsigned     bitbuf;
  23. int         bits_left;
  24. char        zipeof;        /* used as an error flag */
  25.  
  26. int         in_handle;        /* Input file handle */
  27.  
  28. byte        *outbuf;
  29. byte        *outptr;
  30.  
  31. long        outpos;        /* current position in output buffer */
  32. long        outcnt;        /* number of bytes in output buffer */
  33.  
  34. int         out_handle;
  35.  
  36. byte followers[CLEAR][64];
  37. byte Slen[CLEAR];
  38.  
  39.  
  40. int     prefix[HSIZE +1];
  41. byte    suffix[HSIZE +1];
  42. byte    stack[HSIZE +1];
  43.  
  44. int codesize;
  45. int maxcode;
  46. int free_ent;
  47. int maxcodemax;
  48. int offset;
  49.  
  50. static unsigned mask_bits[] =
  51.     {0,     0x0001, 0x0003, 0x0007, 0x000f,
  52.     0x001f, 0x003f, 0x007f, 0x00ff,
  53.     0x01ff, 0x03ff, 0x07ff, 0x0fff,
  54.     0x1fff, 0x3fff, 0x7fff, 0xffff
  55.     };
  56.  
  57. int L_table[] = {0, 0x7f, 0x3f, 0x1f, 0x0f};
  58. int D_shift[] = {0, 0x07, 0x06, 0x05, 0x04};
  59. int D_mask[]  = {0, 0x01, 0x03, 0x07, 0x0f};
  60.  
  61. int B_table[] = {   8, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
  62.                     5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6,
  63.                     6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  64.                     6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
  65.                     7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  66.                     7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  67.                     7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  68.                     7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  69.                     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  70.                     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  71.                     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  72.                     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  73.                     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  74.                     8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  75.                     8, 8, 8, 8};
  76.  
  77.  
  78.